var resdata;
var url;
var trStr;
var sendData = [];
$(document).ready(function(){
	StoreName = decodeURI(decodeURI(StoreName))
	Statue = decodeURI(decodeURI(Statue))
	$('#nameh').append(StoreNO+"."+StoreName);
	$('#Statueh').append(Statue);
	$('#name').text(sessionStorage.getItem("name"));
		$.ajax({
		url: "../../typd/InventorySelect_hc"
		,type:'post'
		,data:JSON.stringify({"PaperNO":PaperNO})
		,contentType: "application/json; charset=utf-8"
		,dataType:'json'
		,success: function(res){
				console.log(res.data);
					for (var i = 0; i < res.data.length; i++) {
					trStr   +='<tr>'
							+'<td>'+res.data[i].GoodsName+'</td>'
							+'<td>'+res.data[i].Baseunit+'</td>'
							+'<td>'+res.data[i].StockQty+'</td>'
							+'<td>'+res.data[i].CheckQty+'</td>'
							+'<td>'+res.data[i].DiffQty+'</td>'
							+'</tr>'
					}
			$('#shujvdiv').append(trStr);
		}
		,error:function(XMLHttpRequest, textStatus, errorThrown) {
			 console.log(XMLHttpRequest);
			 console.log(textStatus);
			 console.log(errorThrown);
			 hideloading();
		}
	});
});
function save() {
    var tableObj = document.getElementById('oTable');
    for (var i = 1; i < tableObj.rows.length; i++) {    //遍历Table的所有Row
			var send = {};
			send.PaperNO =BillNO;
			send.StoreNO ='6001';
			send.GoodsNO = tableObj.rows[i].cells[0].innerText;
			if(tableObj.rows[i].cells[3].innerText==""){
				send.CheckQty= 0 ;
			}else{
				send.CheckQty=Number(tableObj.rows[i].cells[3].innerText);
			}
			sendData.push(send);
    }
	console.log(sendData);
	
	
}
